import {createApp} from 'vue'
import App from './App.vue'

import {createRouter, createWebHistory} from 'vue-router'

const Home = {template: '<div>Home</div>'}
const About = {
  template: `<div>About
    <router-link to="/about/user">Go User</router-link>
    <router-view></router-view>
    </div>`
}
const User = {template: '<div>User</div>,'}
const routes = [
  {path: '/', component: Home},
  {
    path: '/about', component: About, children: [
      {path: 'user', component: User}
    ]
  },
]
const router = createRouter({
  history: createWebHistory(),
  routes,
})

const app = createApp(App)

app.use(router as never)
app.mount('#app')
